<style type="text/css">
.default {
	margin-bottom:10px;
}
.default tr th, .default tr td {
	padding:1px 10px;
	font-size: small; 
}
.default tr th {
	background:#8D0000 url('/images/penjaga_button.png') repeat-x scroll top left;
	color:#ffffff;
}
</style>
 
<%= error_messages_for 'user' %>
<% if flash[:message] %> 
		<p style="color: blue;"><%= flash[:message] %></p>
<% end %>
<% if flash[:warning] %> 
	<p style="color: red;"><%= flash[:message] %></p>
<% end %>
<% if flash[:dbnotsycn] %> 
		<p style="color: blue;"><%= flash[:dbnotsycn] %></p>
			ACL list in your Database is not Syncronize with the Controller.
			You Need to update the list in your Database.<br>
			Click Button Bellow
			<% form_for :group, :url=>{:action => 'paddingAclTable'} do |f| %>			
				<%= submit_tag "Update ACL" %>				
			<% end %>
		
<% end %>
<h3>Manage Group Permission</h3>

<% form_for :group, :url=>{:action => 'manage_acl'} do |f| %>
	<label>Select Group From The List:</label> :
	<%= select("group", "id", @groups.collect {|p| [ p.name, p.id ] }, { :selected => @groupId.to_i }) %>
	<%= submit_tag "Refresh" %>
<% end %>

<% form_for :group, :url=>{:action => 'updateacl'} do |form| %>

	<%= form.hidden_field "id", :size => 20, :value => @groupId %>

	<table class="default" border=0>
	<% @hKontrols.each{|ctl,aktions| %>
		<% if aktions.length > 0 then %>
			<tr>
				<th align=center  colspan=<%= aktions.length + 100%>><%= ctl %></th>
			</tr>
			<tr>
				<% bilRow = 0 %>
				<% aktions.each{|akt,val| %>
				<% bilRow = bilRow + 1 
					if bilRow > 5 then %>
					</td>
					<tr>

				<%		bilRow = 1
					end
				
				%>
					<td align=center ><%= akt %> <br>
					<%= check_box_tag "acl["+ctl+"]["+akt+"]", akt.to_s , @hKontrols[ctl][akt] %> <br>
					 </td>
				<% } %>
			</tr>
		<% end %>
	<% } %>
	</table>
	<label for="group_desc">Group Description: </label>
	<%= form.text_field "desc", :size => 50, :value => @group.desc %><br/>
	<%= submit_tag "Submit" %>

<% end %>

<div style="font-size:x-small;color:white">Greet jijan@https://gallus.honeynet.org.my/</div>
